import Vue from 'vue'
import Router from 'vue-router'
import Login from '../views/login.vue'
import Main from '../views/main.vue'
import Home from '../views/home.vue'


Vue.use(Router)

export default new Router({
  routes: [
   {
    path: '/',
      redirect: '/Login'
   },
    {
      path: '/Login',
      name: 'Login',
      component: Login
    },
    {
      path: '/main',
      name: 'Main',
      component: Main,
      children:[
        {
          path: '/',
          redirect: Home
        },
        {
          path: 'home',
          name: 'Home',
          component: Home,
          meta:{
            title:'首页'
          }
        }]
    },

    {
      path: '/product',
      name: 'product',
      component: Main,
      meta:{
        title:'商品'
      },
      children:[
        {
          path: 'list',
          name: 'ProductList',
          component:()=>import('../views/product/productList.vue'),
          meta:{
            title:'商品列表'
          }
        },
       { path: 'add',
         name: 'ProductAdd',
         component:()=>import('../views/product/productAdd.vue'),
         meta:{
          title:'添加商品'
        }
     },
     { path: 'classify',//分类
         name: 'GoodsCategory',
         component:()=>import('../views/product/productRun.vue'),
         meta:{
          title:'商品分类'
        }
     },
     { path: 'type',//类型
         name: 'ProductTypes',
         component:()=>import('../views/product/productSort.vue'),
         meta:{
          title:'商品类型'
        }
     },
     { path: 'Brand',//品牌
         name: 'BrandManagement',
         component:()=>import('../views/product/brand-management.vue'),
         meta:{
          title:'品牌管理'
        }
     },
      ]
    },
  ]
})
